package html
{
	import flash.display.Sprite;

	public class ReplaceSpecialSymbol extends Sprite
	{
		//替换html中的编码字符
		public function ReplaceSpecialSymbol()
		{
			var testString:String = "This is a test with a &#8211; character and a &#8217;";
			testString = testString.replace(/&#([0-9]+);/g, replaceCharacters);
			trace(testString);
		}
		
		private function replaceCharacters(...args):String
		{
			return String.fromCharCode(parseInt(args[1]));
		}
	}
}